/*
 * This file is part of the <a href="http://code.google.com/p/pux">PUX Framework</a>
 *
 * Copyright 2008-2009 by <a href="mailto:jfendler@polytechnic.edu.na">Jens Fendler</a>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package de.teamskill.pux.engine;

import org.jdom.Element;

/**
 * AbstractXMLNode provides an abstract base class for node implementations
 * whose ports are defined through an XML configuration section (setup element
 * in PUX network scripts)
 * 
 * @author <a href="mailto:jfendler@polytechnic.edu.na">Jens Fendler</a>
 * 
 */
public abstract class AbstractXMLNode extends AbstractNode {

	/**
	 * AbstractXMLNode Constructor
	 * 
	 */
	public AbstractXMLNode() {
		super();
	}

	/**
	 * AbstractXMLNode Constructor
	 * 
	 * @param nodeName
	 * @param continuous
	 */
	public AbstractXMLNode(String nodeName, boolean continuous) {
		super(nodeName, continuous);
	}

	/**
	 * @see de.teamskill.pux.engine.AbstractNode#createPorts()
	 */
	@Override
	protected void createPorts() {

	}

	/**
	 * @see de.teamskill.pux.engine.AbstractNode#setup(java.lang.String)
	 */
	@Override
	public void setup(Object setupData) {
		if (!(setupData instanceof Element)) {
			throw new IllegalArgumentException("Invalid setup data type (" + setupData.getClass().getName()
					+ ") for " + getNodeName() + ". Expected org.jdom.Element.");
		}
		Element se = (Element) setupData;

	}

}
